package com.frxuexi.lib_base.room

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.frxuexi.lib_base.BaseApp

@Database(entities = [User::class,Leave::class], version = 1, exportSchema = false)
abstract class AppDataBase:RoomDatabase() {

    abstract fun userDao():UserDao

    abstract fun leaveDao():LeaveDao

    companion object{
        fun init():AppDataBase{
            //创建数据库
            return Room.databaseBuilder(BaseApp.context,AppDataBase::class.java,"mdm2207").build()
        }
    }
}